//
//  ZHPopupMenuView.h
//  Pods
//
//  Created by Basic on 16/4/5.
//  Copyright © 2016年 zhihan. All rights reserved.s
//  弹出菜单 view
//

#import <Foundation/Foundation.h>
#import "ZHPopupMenuItemModel.h"
#import "ZHPopupMenuPublic.h"


#define kZHPopupMenuDefaultMargin           0
#define kZHPopupMenuView_AllowRoundedArrow  NO
#define kZHPopupMenuView_MenuArrowWidth  ((self.hideArrow)?0:(kZHPopupMenuView_AllowRoundedArrow ? 12 : 6))
#define kZHPopupMenuView_MenuArrowHeight    ((self.hideArrow)?0:(kZHPopupMenuView_AllowRoundedArrow ? 12 : 6))
#define kZHPopupMenuView_MenuRadius         7
#define kZHPopupMenuView_ArrowRadius        4



typedef void (^ZHPopupMenuDoneBlock)(NSInteger selectedIndex, ZHPopupMenuItemModel *menu);
typedef void (^ZHPopupMenuDismissBlock)(void);


#pragma mark - 弹出菜单 itemcell
@interface ZHPopupMenuCell : UITableViewCell

@end



#pragma mark - 弹出菜单 view
@interface ZHPopupMenuView : UIControl
/// 背景色，默认黑色
@property (nonatomic, strong) UIColor   *menuBgColor;
/// title，默认白色
@property (nonatomic, strong) UIColor *menuTitleColor;
/// title，字体默认不设置
@property (nonatomic, strong) UIFont *menuTitleFont;
/// 阴影色，默认不设置
@property (nonatomic, strong) UIColor   *menuShadowColor;
/// 菜单高度，默认 44
@property (nonatomic, assign) CGFloat lineHeight;
@property (nonatomic, assign) CGPoint   anglePoint;
@property (nonatomic, assign) BOOL      shouldAutoScroll;
/// 是否隐藏箭头，默认NO
@property (nonatomic, assign) BOOL  hideArrow;
@property (nonatomic, assign) ZHPopupMenuDirection arrowDirection;

@property (copy, nonatomic) ZHPopupMenuDoneBlock    doneBlock;
@property (copy, nonatomic) ZHPopupMenuDismissBlock dismissBlock;

-(void)showWithFrame:(CGRect )frame withNameArray:(NSArray<ZHPopupMenuItemModel*> *)nameArray doneBlock:(void (^)(NSInteger selectedIndex, ZHPopupMenuItemModel *menu) )doneBlock;
@end
